<template>
  <view class="page"> </view>
</template>
  
<script>
import threeTeamworkService from "@/service/threeTeamwork/three.teamwork.service.js";

export default {
  onLoad() {
    let params = this.getRouteParam();
    this.getMSCoordinationTaskInfo(params.bizUuid);
  },
  methods: {
    // 获取任务详情
    getMSCoordinationTaskInfo(taskUuid) {
      this.$modal.showLoading("加载中...");
      let paras = { taskUuid };
      this.loading = true;
      threeTeamworkService
        .getMSCoordinationTaskInfo(paras)
        .then((res) => {
          this.$modal.hideLoading();
          this.loading = false;
          if (res.success) {
            let toUrl;
            switch (res.bean.tasklist.taskStatus) {
              case "00":
              case "01":
                toUrl = "/pages/threeMembersTeamWork/teamworkCreate";
                break;
              case "02":
              case "03":
              case "04":
              case "05":
              case "06":
              case "07":
                toUrl = "/pages/threeMembersTeamWork/teamworkHandle";
                break;
              default:
                break;
            }

            this.setRouteParam({
              taskUuid: res.bean.tasklist.taskUuid,
            });
            this.$u.route({
              url: toUrl,
              type: "redirect"
            });
          } else {
            this.$u.toast(res.msg);
          }
        })
        .catch(() => {
          this.$u.toast("数据获取失败!");
          this.$modal.hideLoading();
        });
    },
  },
};
</script>
  